using System;
using UnityEngine;
using Unity.VisualScripting;
using ResourceVerifySuccessEventArgs = UnityGameFramework.Runtime.ResourceVerifySuccessEventArgs;

namespace LS.UGFUnits
{
    [UnitShortTitle("Resource Verify")]
    [UnitSurtitle("Success")]
    public sealed class ResourceVerifySuccess : FrameworkEventUnit<ResourceVerifySuccessEventArgs>
    {
        protected override int EventId => ResourceVerifySuccessEventArgs.EventId;
        protected override string HookName => UGFHookNames.ResourceVerifySuccess;

        [DoNotSerialize]
        [PortLabelHidden]
        public ValueOutput Name
        {
            get;
            private set;
        }

        [DoNotSerialize]
        [PortLabelHidden]
        public ValueOutput Length
        {
            get;
            private set;
        }

        protected override void Definition()
        {
            base.Definition();
            Name = ValueOutput<string>(nameof(Name));
            Length = ValueOutput<int>(nameof(Length));
        }

        protected override void AssignArguments(Flow flow, ResourceVerifySuccessEventArgs args)
        {
            base.AssignArguments(flow, args);
            flow.SetValue(Name, args.Name);
            flow.SetValue(Length, args.Length);
        }
    }
}